<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different urls to chosen controllers and their actions (functions).
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.Config
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Here, we are connecting '/' (base path) to controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, /app/View/Pages/home.ctp)...
 */
	Router::connect('/', array('controller' => 'index', 'action' => 'index'));
/**
 * ...and connect the rest of 'Pages' controller's urls.
 */
	Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));

	
/**
 * 首页
 */
	Router::connect( //首页产品分页
		'/page/:page/',
		array('controller' => 'Index', 'action' => 'index'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 用户中心
 */
	Router::connect(
		'/user/:uid/',
		array('controller' => 'User', 'action' => 'index'),
		array('pass' => array('uid'),'uid'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * 品牌购
 */
	Router::connect( //分页
		'/shop/all/:page/',
		array('controller' => 'Shop', 'action' => 'all'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	//分类分页
	Router::connect(
		'/shop/item/:id/',
		array('controller' => 'Shop', 'action' => 'item'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( 
		'/shop/item/:id/:page/',
		array('controller' => 'Shop', 'action' => 'item'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //服装分页
		'/shop/fuzhuang/:page/',
		array('controller' => 'Shop', 'action' => 'fuzhuang'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //配饰分页
		'/shop/peishi/:page/',
		array('controller' => 'Shop', 'action' => 'peishi'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //鞋子分页
		'/shop/xiezi/:page/',
		array('controller' => 'Shop', 'action' => 'xiezi'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //包袋分页
		'/shop/baobao/:page/',
		array('controller' => 'Shop', 'action' => 'baobao'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //居家分页
		'/shop/jujia/:page/',
		array('controller' => 'Shop', 'action' => 'jujia'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //美容分页
		'/shop/meirong/:page/',
		array('controller' => 'Shop', 'action' => 'meirong'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //手机数码分页
		'/shop/shuma/:page/',
		array('controller' => 'Shop', 'action' => 'shuma'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //百货分页
		'/shop/baihuo/:page/',
		array('controller' => 'Shop', 'action' => 'baihuo'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //美食分页
		'/shop/meishi/:page/',
		array('controller' => 'Shop', 'action' => 'meishi'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //图书音像分页
		'/shop/tushu/:page/',
		array('controller' => 'Shop', 'action' => 'tushu'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	Router::connect( //文化娱乐分页
		'/shop/yule/:page/',
		array('controller' => 'Shop', 'action' => 'yule'),
		array('pass' => array('page'),'page'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //品牌购详细页面
		'/shop/:id/',
		array('controller' => 'Shop', 'action' => 'show'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
	Router::connect( //品牌购产品页跳转
		'/jump/:id/',
		array('controller' => 'Shop', 'action' => 'jump'),
		array('pass' => array('id'),'id'=>'[1-9][0-9]{0,9}')
	);
	
/**
 * Load all plugin routes.  See the CakePlugin documentation on 
 * how to customize the loading of plugin routes.
 */
	CakePlugin::routes();

/**
 * Load the CakePHP default routes. Remove this if you do not want to use
 * the built-in default routes.
 */
	require CAKE . 'Config' . DS . 'routes.php';
